import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, Nav } from 'ionic-angular';
import { ParkListPage } from '../park-list/park-list';
import { AboutPage } from '../about/about';

/**
 * Generated class for the ParkSidemenuPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-park-sidemenu',
  templateUrl: 'park-sidemenu.html',
})
export class ParkSidemenuPage {

  @ViewChild(Nav) nav:Nav;
  rootPage:any=ParkListPage;
  pages:Array<{title:string,component:any}>;
  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.pages=[
      {title:'景区',component:ParkListPage},
      {title:'关于',component:AboutPage}];
  }
  openPage(page){
    this.nav.setRoot(page.component);
  }
}
